#ifndef SPHENIX_PRESHOWER_SD_H
#define SPHENIX_PRESHOWER_SD_H

#include <TNamed.h>
#include <vector>
#include <map>

#include "sPHENIX_DetectorConstruction.h"
#include "sPHENIX_CalorimeterHit.h"

using namespace std;

class sPHENIX_PreshowerSD : public TNamed{
 public:
  sPHENIX_PreshowerSD(const char* name, sPHENIX_DetectorConstruction* detector);
  sPHENIX_PreshowerSD();
  virtual ~sPHENIX_PreshowerSD();
  
  // methods
  void     Initialize();
  Bool_t   ProcessHits();
  void     EndOfEvent();
  void     Register();
  virtual void Print(Option_t* option = "") const;
  void     PrintTotal() const;

  // set methods
  void SetVerboseLevel(Int_t level);

  // get methods
  map<int,sPHENIX_CalorimeterHit*>& GetPreshowerTowerEdepCol() {return PreshowerTowerEdepCol;} 

 private:
  // methods
  void ResetHits();

  //data members
  sPHENIX_DetectorConstruction*    Detector;        ///< Detector construction
  Int_t                            SensingMatVolId; ///< Sensing material volume Id
  Int_t                            VerboseLevel;    ///< Verbosity level 
  Int_t                            counter;
  map<int,sPHENIX_CalorimeterHit*>         PreshowerTowerEdepCol;  // Hits Collection
  map<int,sPHENIX_CalorimeterHit*>         *PreshowerTowerEdepColPtr;

  ClassDef(sPHENIX_PreshowerSD, 1);     /// sPHENIX_PreshowerSD

};

/// Set verbose level
/// \param level The new verbose level value
inline void sPHENIX_PreshowerSD::SetVerboseLevel(Int_t level)
{ VerboseLevel = level; }

#endif // SPHENIX_PRESHOWER_SD_H
